package com.wind.cloud.common.util;

import org.springframework.util.StringUtils;

import javax.servlet.http.HttpServletRequest;

/**
 *
 */
public class AjaxUtils {

    public static boolean isAjax(HttpServletRequest request) {
        String accept = request.getHeader("Accept");
        String xrw = request.getHeader("X-Requested-With");
        return StringUtils.hasText(xrw) || (StringUtils.hasText(accept) && accept.contains("json"));
    }

}
